草庐IT

php - heroku 上的 cURL 超时

全部标签

ruby-on-rails - 来自 Rails Heroku 的 Facebook Open Graph

我一整天都在与这个问题作斗争,真的需要一些意见。我有一个在HerokuCedar上运行的Rails应用程序(3.1.3),试图使用gemfb_graph(2.4.0)发布一些FacebookOpenGraph操作。这是我的代码。beginapp=FbGraph::Application.new(ENV['facebook_app_id'])me=FbGraph::User.me(user.facebook_access_token)logger.info"Facebook:User#{user.name}reviewinggame#{game_url(review.game)}"act

ruby-on-rails - 有没有办法在所有 Heroku 测功机上运行命令?

我有N个Rails应用程序测功机,我想对所有测功机运行一个命令。有办法吗?运行railsr"SomeRubyCode"是否会在所有dynos上执行?我使用的插件每M分钟与第三方同步一次。问题是,有时第3方服务会超时,我想再次运行它而不必再等待M分钟。 最佳答案 没有。一次性命令(如herokurunbash)在另一个一次性dyno上运行。您需要设置某种pubsub/消息队列,所有dynos都会收听以完成此操作。https://devcenter.heroku.com/articles/one-off-dynos

ruby-on-rails - Openshift 上的 Ruby "bundle install"错误

我在Ruby和通过远程工具部署应用程序方面还很陌生。我试图在免费的openshift帐户上部署我的应用程序。我无法运行应用程序。当我运行应用程序时出现此错误:Youhavealreadyactivatedrack1.5.2,butyourGemfilerequiresrack1.6.0.Usingbundleexecmaysolvethis.(Gem::LoadError)所以我尝试运行bundleexec但我遇到了另一个错误:Gemfilesyntaxerror:/var/lib/openshift/xxxxxxxxxxxxxxxxxxxxxxxxxx/app-root/runtim

ruby - 如何在 heroku 中使用自己的 mysql 数据库服务器?

我想使用托管在我自己服务器上的mysql数据库。我已经更改了DATABASE_URL和SHARED_DATABASE_URL配置变量以指向我的服务器,但它仍在尝试连接到heroku的amazonaws服务器。我该如何解决? 最佳答案 根据Herokudocumentation,更改DATABASE_URL是正确的方法。Ifyouwouldliketohaveyourrailsapplicationconnecttoanon-Herokuprovideddatabase,youcantakeadvantageofthissamemec

ruby-on-rails - macOS 10.12 Sierra 上的 bundle 错误

Ignoringbinding_of_caller-0.7.2becauseitsextensionsarenotbuilt.Try:gempristinebinding_of_caller--version0.7.2Ignoringbyebug-9.0.6becauseitsextensionsarenotbuilt.Try:gempristinebyebug--version9.0.6Ignoringcapybara-webkit-1.11.1becauseitsextensionsarenotbuilt.Try:gempristinecapybara-webkit--versio

ruby-on-rails - 在 heroku 上通过 bundler 安装 linecache

我在Rails3.0应用程序上使用RVM并使用Ruby1.9.2。whichruby/home/ved/.rvm/rubies/ruby-1.9.2-p136/bin/ruby当我推送到heroku时,出现以下错误:Installinglinecache19(0.5.12)/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygemsinstaller.rb:164:in`install':linecache19requiresRubyversion>=1.9.2(Gem::InstallError)from/usr/ruby1.8.7/lib/ruby/

ruby-on-rails - 如何将数据从我的生产数据库传输到 heroku 中的登台数据库?

我正在尝试将数据从我的生产数据库传输到我的登台数据库,但没有成功。我正在关注heroku的相关文档:http://devcenter.heroku.com/articles/pgbackups#transfers这些是我运行的命令...$herokuaddons:addpgbackups--remotestaging$herokuaddons:addpgbackups--remoteproduction$herokupgbackups:capture--remoteproduction$herokupgbackups:restoreDATABASE`herokupgbackups:ur

ruby-on-rails - 将 Rails/ClearDB App 推送到 Heroku 错误 'Can' t 连接到 '127.0.0.1' 上的 MySQL 服务器

每次我跑:gitpushherokumaster我收到以下错误:Running:rakeassets:precompilerakeaborted!Can'tconnecttoMySQLserveron'127.0.0.1'我在运行rails-vRails3.2.11和ruby-vruby1.9.3p194(2012-04-20revision35410)[x86_64-darwin12.2.0]我已经通过HerokuCLI安装了ClearDB,它似乎工作正常,但我无法找出这个错误。这是我用于生产的yml:production:adapter:mysql2encoding:utf8hos

ruby - 使用 Nokogiri 拆分 BR 标签上的内容

我有一段代码试图用nokogiri解析,看起来像这样:Link1(info1),Blah1,Link2(info1),Blah1,Link3(info2),Blah1Foo2,我可以使用如下方式访问td.j的源代码:data_items=doc.css("td.j")我的目标是将每一行拆分成一个哈希数组。我能看到的唯一合乎逻辑的拆分点是拆分BR,然后在字符串上使用一些正则表达式。我想知道是否有更好的方法来做到这一点,也许只使用nokogiri?即使我可以使用nokogiri来提取3个行项目,它也会使我的事情变得更容易,因为我可以对.content结果进行一些正则表达式解析。但不确定如何

ruby-on-rails - 我的 Rails 4 应用程序上的每个 link_to 都被调用了两次

我的Rails4应用程序遇到一些异常行为。每次我单击View中的link_to时,我的Controller操作都会被调用两次。例如:在我的root_url中,我对users_profile有这个标准调用:"logout-button")%>当我单击此链接时,我的控制台显示以下输出:StartedGET"/users/profile"for127.0.0.1at2013-11-2520:45:53-0200ProcessingbyUsers::SessionsController#profileasHTMLUserLoad(0.7ms)SELECT"users".*FROM"users"